package cn.edu.xmu.rocketmqdemo;

import cn.edu.xmu.rocketmqdemo.model.OrderVo;
import cn.edu.xmu.rocketmqdemo.service.RocketMQService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("cn.edu.xmu.rocketmqdemo")
public class DemoApplication implements CommandLineRunner {
//运行时要调用这些rocketmq方法，必须实现 命令运行接口，重写run方法
	@Autowired
	private RocketMQService rocketMQService;

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		OrderVo orderVo = new OrderVo();
		rocketMQService.sendOrderMessage(orderVo);
	}
}
